<template>
  <view class="flex flex-col items-center">
    <full-loading v-model:visbile="state.loading" />
    <swiper-header :images="carouselImages">
      <nav-bar />
    </swiper-header>
    <nav-bar />
    <nav-bar :show-back="false">
      <template #center>
        <view class="w-full border border-gray-600">
          2323
          <!-- <wd-search :maxlength="10" /> -->
        </view>
      </template>
    </nav-bar>

    <view class="mt-24 px-24">
      <wd-button>主要按钮</wd-button>
      <wd-button type="primary">成功按钮</wd-button>
      <wd-button type="info">信息按钮</wd-button>
      <wd-button type="warning">警告按钮</wd-button>
      <wd-button type="error">危险按钮</wd-button>
    </view>
    <union-link />
  </view>
</template>

<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app'
import { useState } from '@/hooks/use-state'

const carouselImages = [
  'https://cnhqvztoss02.qdama.cn/electricityManagement/pe/202506/ERbfF7yD3SJXciNs4DzDkrePQ84J23Fp.jpg',
  'https://cnhqvztoss02.qdama.cn/electricityManagement/pe/202506/SZ6yh5QGmWQMzrCnFdCsTrNHXAC2WKMM.jpg',
  'https://cnhqvztoss02.qdama.cn/electricityManagement/pe/202506/WF8fG2mWRSDaWEzBRk7bHYNsw5JBbcxP.jpg',
  'https://cnhqvztoss02.qdama.cn/electricityManagement/pe/202505/PteEmEDTXyX3Cy7dbESCthWH4Si4WDTM.jpg',
]

const { state } = useState({
  loading: true,
})

onLoad(async () => {
  await new Promise((resolve) => {
    setTimeout(() => {
      state.loading = false
      resolve(true)
    }, 2000)
  })
  // const result = await login()
  // console.log(result, 18)
})
</script>

<style></style>
